﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Graph
{
/// <summary>
    /// Represents a vertex in a graph
    /// </summary>
    public class Vertex
    {
        private string name;
        private bool mark;
        private IList<Vertex> edgelist;

        public Vertex()
        {
        }

        public Vertex(string name)
        {
            mark = false;
            this.name = name;
            edgelist = new List<Vertex>();
        }

        public string getName()
        {
            return name;
        }

        public void setName(string n)
        {
            name = n;
        }

        public bool getMark()
        {
            return mark;
        }

        public void setMark(bool m)
        {
            mark = m;
        }

        public override string ToString()
        {
            return name;
        }

        //public string Name
        //{
        //}

        //public bool Mark
        //{
        //}

        public IList<Vertex> Edges()
        {
            return edgelist;
        }


        public void AddEdge(Vertex v)
        {
            edgelist.Add(v);
        }

        //public int OutDegree
        //{
        //}

        public void RemoveEdge(Vertex v)
        {
            edgelist.Remove(v);
        }
    }
}